GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( eed820...519259 )
by Florian
27s
created

$(document).ready   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 1
rs 10
c 0
b 0
f 0
1
/*jslint
2
  indent: 4
3
*/
4
5
/*global
6
  $, document, gapi, setTimeout,
7
  CDDA, Cookies, Coordinates, Freifunk, Hillshading, NPA, Okapi, Sidebar,
8
  DownloadGPX,
9
  showMulticoordinatesDialog, Markers, get_cookie_string
10
*/
11
12
///* boundaries layer */
13
//function toggleBoundaries(t)
14
//{
15
//  Cookies.set('boundaries', t ? "1" : "0", {expires:30});
16
//
17
//  if ($('#boundaries').is(':checked') != t)
18
//  {
19
//    $('#boundaries').attr('checked', t);
20
//  }
21
//
22
//  if( boundariesLayerShown == t ) return;
23
//  boundariesLayerShown = t;
24
//
25
//  if (t) {
26
//    map.overlayMapTypes.push(boundariesLayer);
27
//  } else {
28
//    map.overlayMapTypes.removeAt(map.overlayMapTypes.indexOf(boundariesLayer));
29
//  }
30
//}
31
//
32
//function restoreBoundaries(defaultValue)
33
//{
34
//  var state = get_cookie_string("boundaries", "invalid");
35
//
36
//  if (state == "0")
37
//  {
38
//    toggleBoundaries(false);
39
//  }
40
//  else if (state == "1")
41
//  {
42
//    toggleBoundaries(true);
43
//  }
44
//  else
45
//  {
46
//    toggleBoundaries(defaultValue);
47
//  }
48
//}
49
50
51
/* coordinate format */
52
function setCoordinatesFormat(t) {
53
    'use strict';
54
55
    Cookies.set('coordinatesFormat', t, {expires: 30});
56
57
    if ($('#coordinatesFormat').val() !== t) {
58
        $('#coordinatesFormat').val(t);
59
    }
60
61
    Coordinates.setFormat(t);
62
    Markers.update();
63
}
64
65
66
function restoreCoordinatesFormat(defaultValue) {
67
    'use strict';
68
69
    var t = get_cookie_string("coordinatesFormat", "DM");
70
71
    if (t === "DM" || t === "DMS" || t === "D") {
72
        setCoordinatesFormat(t);
73
    } else {
74
        setCoordinatesFormat(defaultValue);
75
    }
76
}
77
78
79
/* info dialog */
80
function showInfoDialog() {
81
    'use strict';
82
83
    $('#dlgInfoAjax').modal({show : true, backdrop: "static", keyboard: true});
84
}
85
86
87
/* alert dialog */
88
function showAlert(title, msg) {
89
    'use strict';
90
91
    $("#dlgAlertHeader").html(title);
92
    $("#dlgAlertMessage").html(msg);
93
    $("#dlgAlert").modal({show : true, backdrop: "static", keyboard: true});
94
}
95
96
97
/* projection dialog */
98
function showProjectionDialog(callback) {
99
    'use strict';
100
101
    $('#projectionDialogOk').off('click');
102
    $('#projectionDialogOk').click(function () {
103
        $('body').removeClass('modal-open');
104
        $('.modal-backdrop').remove();
105
        $('#projectionDialog').modal('hide');
106
        if (callback) {
107
            setTimeout(function () {
108
                callback($("#projectionBearing").val(), $("#projectionDistance").val());
109
            }, 10);
110
        }
111
    });
112
    $("#projectionDialog").modal({show : true, backdrop: "static", keyboard: true});
113
}
114
115
116
/* permalink dialog */
117
function showLinkDialog(linkUrl) {
118
    'use strict';
119
120
    $('#linkDialogLink').val(linkUrl);
121
    $('#linkDialog').modal({show : true, backdrop: "static", keyboard: true});
122
    $('#linkDialogLink').select();
123
}
124
125
126
function linkDialogShortenLink() {
127
    'use strict';
128
129
    var longUrl = $('#linkDialogLink').val();
130
    gapi.client.setApiKey('AIzaSyC_KjqwiB6tKCcrq2aa8B3z-c7wNN8CTA0');
131
    gapi.client.load('urlshortener', 'v1', function () {
132
        var request = gapi.client.urlshortener.url.insert({'resource': {'longUrl': longUrl}});
133
        request.execute(function (resp) {
134
            if (resp.error) {
135
                $('#linkDialogError').html('Error: ' + resp.error.message);
136
            } else {
137
                $('#linkDialogLink').val(resp.id);
138
                $('#linkDialogLink').select();
139
            }
140
        });
141
    });
142
}
143
144
//function showHillshadingDialog()
145
//{
146
//  $('#dialogHillshading').modal({show : true, backdrop: "static", keyboard: true});
147
//}
148
149
//function showBoundariesDialog()
150
//{
151
//  $('#dialogBoundaries').modal({show : true, backdrop: "static", keyboard: true});
152
//}
153
154
155
/* setup button events */
156
$(document).ready(function () {
157
    'use strict';
158
159
    $("#sidebartoggle").click(function () { if ($('#sidebar').is(':visible')) { Sidebar.hide(); } else { Sidebar.show(); } });
160
    $('#buttonWhereAmI').click(function () { Geolocation.whereAmI(); });
0 ignored issues
show
Bug introduced by
The variable Geolocation seems to be never declared. If this is a global, consider adding a /** global: Geolocation */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
161
    $("#hillshading").click(function () { Hillshading.toggle($('#hillshading').is(':checked')); });
162
    //$("#boundaries").click(function () { toggleBoundaries($('#boundaries').is(':checked')); });
163
    $("#npa").click(function () { NPA.toggle($('#npa').is(':checked')); });
164
    $("#cdda").click(function () { CDDA.toggle($('#cdda').is(':checked')); });
165
    $("#geocaches").click(function () { Okapi.toggle($('#geocaches').is(':checked')); });
166
    $('#coordinatesFormat').change(function () { setCoordinatesFormat($('#coordinatesFormat').val()); });
167
    $("#freifunk").click(function () { Freifunk.toggle($('#freifunk').is(':checked')); });
168
    $("#buttonUploadGPX").click(function (e) { $("#buttonUploadGPXinput").click(); e.preventDefault(); });
169
    $("#buttonExportGPX").click(function () { DownloadGPX.initiateDownload(); });
170
    $("#buttonMulticoordinates").click(function () { showMulticoordinatesDialog(); });
171
});
172